package org.vshe.improve.spring.prospring3.ch6;

import org.springframework.aop.framework.ProxyFactory;

public class ProxyTest {

	
	public static void main(String[] args) {
		MessageWriter writer = new MessageWriter();
		
		ProxyFactory factory = new ProxyFactory();
		factory.setTarget(writer);
		factory.addAdvice(new MessageDecorator());
		
		MessageWriter proxy = (MessageWriter) factory.getProxy();
		proxy.writeMessage();
	}

}
